package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.entity.bean.GoodsDetailsBean;
import com.common.retrofit.service.HaiNingService;

import rx.Observable;
import rx.Subscriber;

public class GoodsDetailsMethods extends BaseMethods {

    private static GoodsDetailsMethods m_ins = null;

    public static GoodsDetailsMethods getInstance() {
        if (m_ins == null) {
            synchronized (GoodsDetailsMethods.class) {
                if (m_ins == null) {
                    m_ins = new GoodsDetailsMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "Goods/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }


    public void detail(Subscriber<GoodsDetailsBean> subscriber,
                      int gid ) {
        Observable observable = initService().detail(System.currentTimeMillis()+"",
                "79de39970806a0bc911b1cf7ded87d78",gid
        );
        toSubscribe(observable, subscriber);
    }
}
